<?php
/**
 * Created by 张彪.
 * User: 小马出行
 * Date: 2018/1/11
 * Time: 11:18
 */
namespace app\inter\model;
use \think\Model;
use think\Db;
class AreaModel extends Model
{
    public function getAreaInfo($map,$field='*',$flag=true,$page=1,$limit=10,$config='')
    {
        return $flag?Db::table('inter_arean')->where($map)->field($field)->page($page,$limit)->order('id desc')->select()
            :Db::table('inter_arean')->where($map)->field($field)->order('id desc')->find();
    }

    public function addArean($data)
    {
        return Db::table('inter_arean')->insertGetId($data);
    }

    public function updateArean($map,$data)
    {
        return Db::table('inter_arean')->where($map)->update($data);
    }

    public function searchArean($map,$field='*')
    {
        return Db::table('inter_arean')->where($map)->field($field)->find();
    }

    public function delArean($map)
    {
        return Db::table('inter_arean')->where($map)->delete();
    }
}